CC = gcc
COPTS = -Wall -Wextra -g3
CLIBS = -lSDL -lSDL_gfx -lm
COMP = $(CC) $(CLIBS) $(COPTS)
EXE = vision_test
OBJS = $(EXE).o eg_vision.o eg_data.o eg_geom.o eg_map.o

all: $(EXE)

$(EXE): $(OBJS)
	@echo "== Linking =="
	$(COMP) $^ -o $@

$(EXE).o: $(EXE).c vision_test.h eg_vision.h eg_data.h eg_geom.h
	@echo "== Compiling =="
	$(COMP) -c $< -o $@

eg_vision.o: eg_vision.c eg_vision.h eg_data.h eg_geom.h
	$(COMP) -c $< -o $@

eg_geom.o: eg_geom.c eg_geom.h eg_data.h

eg_data.o: eg_data.c eg_data.h
	$(COMP) -c $< -o $@

eg_map.o: eg_map.c eg_map.h eg_data.h eg_geom.h 
	$(COMP) -c $< -o $@

clean:
	-rm *.o $(EXE)
